package cn.lger.encoder;

import org.mindrot.jbcrypt.BCrypt;

/**
 * 密码加密、匹配继承类
 *
 * @author Pro
 * @date 2018-06-27.
 */
public class PasswordEncoderImpl implements PasswordEncoder {


    @Override
    public String encoder(String password) {
        return BCrypt.hashpw(password, BCrypt.gensalt());
    }

    @Override
    public boolean matches(String source, String coder) {
        return BCrypt.checkpw(source, coder);
    }

}
